package org.apache.james.mime4j.util;

import java.nio.charset.Charset;

public final class MessageUtils
{
  public static final Charset ASCII = CharsetUtil.getCharset("US-ASCII");
  public static final int CR = 13;
  public static final String CRLF = "\r\n";
  public static final Charset DEFAULT_CHARSET;
  public static final int HT = 9;
  public static final Charset ISO_8859_1 = CharsetUtil.getCharset("ISO-8859-1");
  public static final int LENIENT = 3;
  public static final int LF = 10;
  public static final int SP = 32;
  public static final int STRICT_ERROR = 2;
  public static final int STRICT_IGNORE = 1;

  static
  {
    DEFAULT_CHARSET = ASCII;
  }

  public static boolean isASCII(char paramChar)
  {
    int i;
    if ((0xFF80 & paramChar) == 0)
      i = 1;
    while (true)
    {
      return i;
      i = 0;
    }
  }

  public static boolean isASCII(String paramString)
  {
    int k;
    if (paramString == null)
      throw new IllegalArgumentException("String may not be null");
    int i = paramString.length();
    int j = 0;
    if (j < i)
      if (!(isASCII(paramString.charAt(j))))
        k = 0;
    while (true)
    {
      while (true)
      {
        return k;
        ++j;
      }
      k = 1;
    }
  }

  public static boolean isWhitespace(char paramChar)
  {
    int i;
    if ((paramChar == ' ') || (paramChar == '\t') || (paramChar == '\r') || (paramChar == '\n'))
      i = 1;
    while (true)
    {
      return i;
      i = 0;
    }
  }
}